package com.wsz.bot.controller;

import com.wsz.bot.service.BotRunService;
import com.wsz.pojo.R;
import com.wsz.pojo.dto.BotDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BotController {

    @Autowired
    private BotRunService botRunService;

    @GetMapping("/test")
    public R test(){
        return R.ok().data("success","BOT");
    }

    @PostMapping("/add")
    public R addBot(@RequestBody BotDto botDto){
        return botRunService.addBot(botDto);
    }

}
